package ads.util;

import java.io.Serializable;

import ads.client.LoginFrame;
import ads.remote.ClientInterface;
import at.falb.games.alcatraz.api.Player;

public class PlayerInfo implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -823040765411223232L;
	private Player player;
	private ClientInterface stub;

	public PlayerInfo(Player player, ClientInterface stub) {
		super();
		this.player = player;
		this.stub = stub;
	}

	public Player getPlayer() {
		return player;
	}

	public void setPlayer(Player player) {
		this.player = player;
	}

	public ClientInterface getStub() {
		return stub;
	}

	public void setStub(ClientInterface stub) {
		this.stub = stub;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null)
			return false;
		if (obj == this)
			return true;
		if (this.getPlayer() == null)
			return false;
		if (obj instanceof PlayerInfo) {
			PlayerInfo other = (PlayerInfo) obj;
			if (this.getPlayer().equals(other.getPlayer())) {
				return true;
			}
		}
		return false;
	}

	@Override
	public String toString() {

		return this.getPlayer().toString() + ", stub"
				+ this.getStub().toString();
	}
}
